<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Parse a configuration string</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.parse-ini-file.html">parse_ini_file</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pathinfo.html">pathinfo</a></div>
 <div class="up"><a href="ref.filesystem.html">Filesystem 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.parse-ini-string" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">parse_ini_string</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">parse_ini_string</span> &mdash; <span class="dc-title">Parse a configuration string</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.parse-ini-string-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>parse_ini_string</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$ini</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$process_sections</code><span class="initializer"> = false</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$scanner_mode</code><span class="initializer"> = INI_SCANNER_NORMAL</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>parse_ini_string()</strong></span> returns the settings in string
   <em><code class="parameter">ini</code></em> in an associative array.
  </p>
  <p class="para">
   The structure of the ini string is the same as the <var class="filename">php.ini</var>&#039;s.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.parse-ini-string-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">ini</code></em></dt>

     <dd>

      <p class="para">
       The contents of the ini file being parsed.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">process_sections</code></em></dt>

     <dd>

      <p class="para">
       By setting the <em><code class="parameter">process_sections</code></em>
       parameter to <strong><code>TRUE</code></strong>, you get a multidimensional array, with
       the section names and settings included. The default
       for <em><code class="parameter">process_sections</code></em> is <strong><code>FALSE</code></strong>      
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">scanner_mode</code></em></dt>

     <dd>

      <p class="para">
       Can either be <strong><code>INI_SCANNER_NORMAL</code></strong> (default) or 
       <strong><code>INI_SCANNER_RAW</code></strong>. If <strong><code>INI_SCANNER_RAW</code></strong> 
       is supplied, then option values will not be parsed.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.parse-ini-string-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The settings are returned as an associative <span class="type"><a href="language.types.array.html" class="type array">array</a></span> on success,
   and <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.parse-ini-string-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    There are reserved words which must not be used as keys for
    ini files.  These include: null, yes, no, true, false, on, off, none.
    Values null, no and false results in &quot;&quot;, yes and true results in &quot;1&quot;.
    Characters <em>?{}|&amp;~![()^&quot;</em> must not be used anywhere in
    the key and have a special meaning in the value.
   </span>
  </p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.parse-ini-string-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.parse-ini-file.html" class="function" rel="rdfs-seeAlso">parse_ini_file()</a> - 解析一个配置文件</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.parse-ini-file.html">parse_ini_file</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pathinfo.html">pathinfo</a></div>
 <div class="up"><a href="ref.filesystem.html">Filesystem 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
